﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace JobShop
{
    [Description("Represents the solution with complete information of tasks and gaps")]
    public class TcSolution : TiDuplicable<TcSolution>
    {
        private readonly Int32 M;
        private readonly Int32 N;
        public Int32 Row { get; private set; }
        public Int32 Column { get; private set; }
        public Int32[,] Solution { get; set; }
        public Int32 Fitness { get; set; }
        //------------------------------------------------------------------------------

        public TcSolution(Int32 prmMachine, Int32 prmJob)
        {
            M = prmMachine;
            N = prmJob;
            Row = prmMachine;
            Column = prmJob * 6;
            Solution = new Int32[Row, Column];
            Fitness = default(Int32);
        }
        //------------------------------------------------------------------------------

        public TcSolution Duplicate()
        {
            return Clone() as TcSolution;
        }
        //------------------------------------------------------------------------------

        public object Clone()
        {
            TcSolution clone = new TcSolution(M, N);
            clone.Row = Row;
            clone.Column = Column;
            clone.Fitness = Fitness;
            Array.Copy(Solution, clone.Solution, Row * Column);
            return clone;
        }
        //------------------------------------------------------------------------------

    }
    //------------------------------------------------------------------------------

}
//------------------------------------------------------------------------------
